<?php
/**
 * Created by PhpStorm.
 * User: cy
 * Date: 18-4-22
 * Time: 下午10:03
 */
$http = new swoole_http_server("0.0.0.0", 9501);
$http->set([
    'enable_static_handler'=>true,
    'document_root'=>"/var/www/blog.static/root@www.rentmaterial.com"
]);
$http->on('request', function ($request, $response) {

    $response->end("<h1>Hello Swoole. #".rand(1000, 9999)."</h1>".json_encode($request->get));
});
$http->start();